﻿using System;
using System.Windows.Media;

namespace Demos.GraphColorer
{
    class ColorPicker
    {
        private readonly Random _r;
        private readonly BrushConverter _converter;

        public ColorPicker()
        {
            _r = new Random(DateTime.Now.Millisecond);
            _converter = new BrushConverter();
        }

        public Brush Next()
        {
            var a = _r.Next(0x1000000);
            var colorCadena = string.Format("#{0:X6}", a);
            return (Brush)_converter.ConvertFromString(colorCadena);
        }
    }
}
